From: Keir Fraser Date: Mon, 6 Jul 2009 10:58:02 +0000 (+0100) Subject: x86, hvm: fix get msix entry error X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13639 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=df117d7fe37890c4a9c6fb18f2011964c02bf9b2;p=xen.git x86, hvm: fix get msix entry error There is a mistake to get the msix entry number. It should be divide instead of modulus. Signed-off-by: Yang Zhang Signed-off-by: Qing He --- diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c index 37c1e5c14f..e6bc057dcd 100644 --- a/xen/arch/x86/hvm/vmsi.c +++ b/xen/arch/x86/hvm/vmsi.c @@ -290,7 +290,7 @@ static int msixtbl_write(struct vcpu *v, unsigned long address, goto out; entry = msixtbl_find_entry(v, address); - nr_entry = (address - entry->gtable) % PCI_MSIX_ENTRY_SIZE; + nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE; offset = address & (PCI_MSIX_ENTRY_SIZE - 1); if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET)